  //Filename: main.c  
	#include "includes.h"
     
     void Delay(Int32U);
     
     int main(void)
     {
     	LEDInit();
			KEYInit();
			LED(0,LED_OFF);
    	LED(1,LED_OFF);
			 
    	for(;;)
    	{
				if(KEY_Scan(0)==0)
				{ while(KEY_Scan(0)==0)					
							LED(0,LED_OFF);
							LED(1,LED_OFF);
				}
				
				if(KEY_Scan(2)==0)
				{ while(KEY_Scan(2)==0)					
							LED(1,LED_ON);
							LED(0,LED_ON);
				}
				
				if(KEY_Scan(1)==0)
				{ while(KEY_Scan(1)==0)
					
							LED(1,LED_ON);
							LED(0,LED_OFF);
				}
    
    	}
    }
    
    void Delay(Int32U u)
    {
    	Int32U i,j;
    	for(i=0;i<u;i++)
    		for(j=0;j<12000;j++);
    }
